package com.cbn.ibcp.jishiting.gs.cms.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.cbn.ibcp.common.annotation.DataSource;
import com.cbn.ibcp.common.enums.DataSourceType;
import com.cbn.ibcp.jishiting.gs.cms.domain.Cp;
import com.cbn.ibcp.jishiting.gs.cms.mapper.CpMapper;
import com.cbn.ibcp.jishiting.gs.cms.service.ICpService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@RequiredArgsConstructor
public class CpServiceImpl implements ICpService {

    private final CpMapper cpMapper;


    @DataSource(DataSourceType.gs_cms)
    @Override
    public List<Cp> selectList() {
        LambdaQueryWrapper<Cp> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(Cp::getStatus, 1);
        return cpMapper.selectList(queryWrapper);
    }
}
